package com.ruowei.modules.foodOrder.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;

import java.io.Serializable;
import java.time.Instant;

/**
 * 订单生命周期表
 */
@ApiModel(description = "订单生命周期表")
@Entity
@Table(name = "order_life_cycle")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class OrderLifeCycle implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 订单号
     */
    @ApiModelProperty(value = "订单号")
    @Column(name = "order_code")
    private String orderCode;

    /**
     * 退款编码
     */
    @ApiModelProperty(value = "退款编码")
    @Column(name = "order_rerun_code")
    private String orderRerunCode;

    /**
     * 标题
     */
    @ApiModelProperty(value = "标题")
    @Column(name = "title")
    private String title;

    /**
     * 时间
     */
    @ApiModelProperty(value = "时间")
    @Column(name = "jhi_time")
    private Instant time;

    /**
     * 描述
     */
    @ApiModelProperty(value = "描述")
    @Column(name = "description")
    private String description;

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getOrderCode() {
        return orderCode;
    }

    public OrderLifeCycle orderCode(String orderCode) {
        this.orderCode = orderCode;
        return this;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    public String getOrderRerunCode() {
        return orderRerunCode;
    }

    public OrderLifeCycle orderRerunCode(String orderRerunCode) {
        this.orderRerunCode = orderRerunCode;
        return this;
    }

    public void setOrderRerunCode(String orderRerunCode) {
        this.orderRerunCode = orderRerunCode;
    }

    public String getTitle() {
        return title;
    }

    public OrderLifeCycle title(String title) {
        this.title = title;
        return this;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Instant getTime() {
        return time;
    }

    public OrderLifeCycle time(Instant time) {
        this.time = time;
        return this;
    }

    public void setTime(Instant time) {
        this.time = time;
    }

    public String getDescription() {
        return description;
    }

    public OrderLifeCycle description(String description) {
        this.description = description;
        return this;
    }

    public void setDescription(String description) {
        this.description = description;
    }
    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof OrderLifeCycle)) {
            return false;
        }
        return id != null && id.equals(((OrderLifeCycle) o).id);
    }

    @Override
    public int hashCode() {
        return 31;
    }

    @Override
    public String toString() {
        return "OrderLifeCycle{" +
            "id=" + getId() +
            ", orderCode='" + getOrderCode() + "'" +
            ", orderRerunCode='" + getOrderRerunCode() + "'" +
            ", title='" + getTitle() + "'" +
            ", time='" + getTime() + "'" +
            ", description='" + getDescription() + "'" +
            "}";
    }
}
